import { request } from './index'

// 获得购物车产品
export function GetList (data: string) {
  return request({
    url: `/api/carts?${data}`,
    method: 'get'
  })
}

// 购物车单选选中
export function CheckedCart (data: any) {
  return request({
    url: '/api/carts/checked',
    method: 'patch',
    data: data
  })
}

// 修改单个产品数量
export function UndateNum (id: string, data: { num: string }) {
  return request({
    url: `/api/carts/${id}`,
    method: 'put',
    data: data
  })
}

// 删除产品
export function DeleteProduct (id: number) {
  return request({
    url: `/api/carts/${id}`,
    method: 'delete'
  })
}
